<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use App\Models\Catalog;

class CatalogTableSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('catalogs')->delete();

        Catalog::create(['name' => '电子产品']);
        Catalog::create(['name' => '手机', 'p_id' => 1, 'level' => 2]);
        Catalog::create(['name' => '电视', 'p_id' => 1, 'level' => 2]);
        Catalog::create(['name' => '木质产品']);
        Catalog::create(['name' => '椅子', 'p_id' => 4, 'level' => 2]);
        Catalog::create(['name' => '桌子', 'p_id' => 4, 'level' => 2]);
    }

}
